corrected slect allocation