Fixed perdition issues