Fixed bug with preference activity