Fixed the bed functionality