fixed bug in after_created method